//
//  MXYLukyMoneySectionView.m
//  meiyinxiang
//
//  Created by apple on 2017/11/1.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MXYLukyMoneySectionView.h"
#import "LocationRangeModel.h"
@interface MXYLukyMoneySectionView()
@property (weak, nonatomic) IBOutlet UILabel *sectionCateTitleLable;
@property (weak, nonatomic) IBOutlet UIImageView *sectionImageView;
@property (weak, nonatomic) IBOutlet UILabel *sectionTitleLable;
@property (weak, nonatomic) IBOutlet UIImageView *arrowImageView;

@end
@implementation MXYLukyMoneySectionView
+ (MXYLukyMoneySectionView *)loadNibWithSectionView{
    UINib *nib = [UINib nibWithNibName:@"MXYLukyMoneySectionView" bundle:[NSBundle mainBundle]];
    return [[nib instantiateWithOwner:nil options:nil] lastObject];
}
- (void)awakeFromNib{
    [super awakeFromNib];
   
   
}
- (void)setModel:(ComposeMoneyModel *)model{
    if ([model.sectionTitle isEqualToString:@"位置范围"]) {
        self.arrowImageView.image = [UIImage imageNamed:@"youxiangjian"];
           [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(revieveNotice:) name:PostChangeLocationRangeName object:nil];
    }
    self.sectionCateTitleLable.text = model.sectionCateTitle;
    self.sectionTitleLable.text = model.sectionTitle;
    self.sectionImageView.image = [UIImage imageNamed:model.sectionImg];
}
#pragma mark - PrivateMethod
- (void)revieveNotice:(NSNotification *)noti{
    LocationRangeModel *rangeModel = (LocationRangeModel *)noti.object;
    self.sectionCateTitleLable.text = rangeModel.locationRange;
}
- (void)dealloc{
    [[NSNotificationCenter defaultCenter] removeObserver:self name:PostChangeLocationRangeName object:nil];
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
